package cn.com.haopy.yue.ai.admin.web;

import cn.com.haopy.yue.ai.admin.annotation.RequiresPermissionsDesc;
import cn.com.haopy.yue.ai.core.utils.ResponseUtil;
import cn.com.haopy.yue.ai.core.validator.Order;
import cn.com.haopy.yue.ai.core.validator.Sort;
import cn.com.haopy.yue.ai.db.entity.arisk.AIRiskCheckIndex;
import cn.com.haopy.yue.ai.db.entity.arisk.AIRiskUserHumanQueue;
import cn.com.haopy.yue.ai.db.service.hos.AIRiskUserHumanQueueService;
import cn.com.haopy.yue.ai.db.service.hos.AIRiskUserHumanSourceService;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Description: TODO
 * @Author DuTao
 * @Date 2025/4/22 8:43
 */
@RestController
@RequestMapping("/admin/risk/user/human/queue")
@RequiredArgsConstructor
@Slf4j
@Api(tags = "数字人队列相关")
public class AdminAiRiskHumanQueueController {
    @Autowired
    private AIRiskUserHumanQueueService humanQueueService;

    @RequiresPermissions("admin:risk:user:human:queue:list")
    @RequiresPermissionsDesc(menu = {"队列管理", "队列列表"}, button = "队列列表")
    @GetMapping("/list")
    @ApiOperation("列表")
    public Object list(@RequestParam(defaultValue = "1") Integer page,
                       @RequestParam(defaultValue = "10") Integer limit,
                       @Sort @RequestParam(defaultValue = "create_time") String sort,
                       @Order @RequestParam(defaultValue = "desc") String order) {
        Page<AIRiskUserHumanQueue> queueList = humanQueueService.querySelective(page, limit, sort, order);
        return ResponseUtil.okPage(queueList);
    }
}
